FROM  maven:3.6.3-openjdk-17 AS builder
WORKDIR /application
COPY . ./
RUN set -ex;\
    mvn clean package -Dmaven.test.skip=true -Dmaven.build.timestamp="$(date "+%Y-%m-%d %H:%M:%S")";\
    cp mulanbay-pms/target/mulanbay-pms-5.0.jar ./application.jar;

FROM  openjdk:17

EXPOSE 8080
# 挂载目录
VOLUME /home/knowledgegraph
# 创建目录
RUN mkdir -p /home/knowledgegraph
# 指定路径
WORKDIR /home/knowledgegraph
# 复制jar文件到路径
COPY --from=builder /application/application.jar /home/knowledgegraph/application.jar
# 启动认证服务
ENTRYPOINT ["java","-jar","application.jar"]